package demo;

//Day01
public class Day11001 {
    public static void main(String[] args) {
        Refrigerator refrigerator = new Refrigerator("美的", "111", "白", 3965.99, "双开门", "三级制冷");
        Washer washer = new Washer("海尔", "222", "天蓝", 2874.99, "二型", "12L");
        System.out.println(refrigerator.toString());
        System.out.println(washer.toString());
    }
}

//电器类
class Appliance {
    private String brand;   //品牌
    private String model;   //型号
    private String color;   //颜色
    private Double price;   //售价

    public Appliance() {
    }

    public Appliance(String brand, String model, String color, Double price) {
        this.brand = brand;
        this.model = model;
        this.color = color;
        this.price = price;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Appliance{" +
                "brand='" + brand + '\'' +
                ", model='" + model + '\'' +
                ", color='" + color + '\'' +
                ", price=" + price +
                '}';
    }
}

//冰箱类
class Refrigerator extends Appliance {
    private String style;   //门款式
    private String mode;    //制冷方式

    public Refrigerator() {
        super();
    }

    public Refrigerator(String brand, String model, String color, Double price, String style, String mode) {
        super(brand, model, color, price);
        this.style = style;
        this.mode = mode;
    }

    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public String getMode() {
        return mode;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    @Override
    public String toString() {
        return "Refrigerator{" +
                "style='" + style + '\'' +
                ", mode='" + mode + '\'' +
                "} " + super.toString();
    }
}

//洗衣机类
class Washer extends Appliance {
    private String type;    //电机类型
    private String capacity;//洗涤容量

    public Washer() {
    }

    public Washer(String brand, String model, String color, Double price, String type, String capacity) {
        super(brand, model, color, price);
        this.type = type;
        this.capacity = capacity;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCapacity() {
        return capacity;
    }

    public void setCapacity(String capacity) {
        this.capacity = capacity;
    }

    @Override
    public String toString() {
        return "Washer{" +
                "type='" + type + '\'' +
                ", capacity='" + capacity + '\'' +
                "} " + super.toString();
    }
}
